
Page({
  data: {
    goodsList: [
      { name: '追源杨梅干', img: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-b1ebbd3c-ca49-405b-957b-effe60782276/c8c4e05e-42d4-4a22-b111-85765d4e22e2.jpg', price: 108, saled: 850, rest: true },//saled库存
      { name: '追源深山土蜂蜜', img: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-b1ebbd3c-ca49-405b-957b-effe60782276/3c1553fe-b9c3-476f-8598-0cd2d09d3999.jpg', price: 98, saled: 350, rest: true },
      { name: '杨梅干2罐起包邮【专拍】', img: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-b1ebbd3c-ca49-405b-957b-effe60782276/fe5343f9-b925-4759-a423-e0005f965ede.jpg', price: 69, saled: 2650, rest: true },
      { name: '追源杨梅干', img: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-b1ebbd3c-ca49-405b-957b-effe60782276/c8c4e05e-42d4-4a22-b111-85765d4e22e2.jpg', price: 69, saled: 2456, rest: true },
      { name: '追源深山土蜂蜜', img: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-b1ebbd3c-ca49-405b-957b-effe60782276/3c1553fe-b9c3-476f-8598-0cd2d09d3999.jpg', price: 258, saled: 601, rest: true },
      { name: '杨梅干2罐起包邮【专拍】', img: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-b1ebbd3c-ca49-405b-957b-effe60782276/fe5343f9-b925-4759-a423-e0005f965ede.jpg', price: 258, before:"",saled: 550, rest: true },
      { name: '追源杨梅干', img: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-b1ebbd3c-ca49-405b-957b-effe60782276/c8c4e05e-42d4-4a22-b111-85765d4e22e2.jpg', price: 12.5, before: 19, saled: 4720, rest: true },
      { name: '追源深山土蜂蜜', img: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-b1ebbd3c-ca49-405b-957b-effe60782276/3c1553fe-b9c3-476f-8598-0cd2d09d3999.jpg', price: 9.9, before: 15, saled: 4456 },
    ]
  },
  onClick:function(e){
      console.log(e);
      if (!wx.getStorageSync('goodsList')){
        wx.setStorageSync('goodsList', this.data.goodsList);
      }
     
      wx.navigateTo({
        url: '/pages/product/product?index=' + e.currentTarget.dataset.index,
      })
  }
})